home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
credit1a
/
frmmain.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1999-08-28
|
2KB
|
56 lines
VERSION 5.00
Begin VB.Form frmMain
AutoRedraw = -1 'True
BackColor = &H00000000&
Caption = "VBCredits"
ClientHeight = 3690
ClientLeft = 60
ClientTop = 345
ClientWidth = 5940
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
LinkTopic = "Form1"
ScaleHeight = 246
ScaleMode = 3 'Pixel
ScaleWidth = 396
StartUpPosition = 3 'Windows Default
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim myCredits As New cCredits ' The credits object
Private Sub Form_Load()
' Frame limiter
Dim CurTime As Long, NextTime As Long
Me.Show ' ALWAYS make sure the form is shown before entering a loop
myCredits.PosY = Me.ScaleHeight ' Set the Y position of the credits
LoadTXT ' call sub to load the text in the text file into the VBCredits strings
Do While DoEvents() ' Do until the program ends
CurTime = timeGetTime() ' Get the current time
If CurTime >= NextTime Then ' If the time is right to execute the next frame
Me.Cls
' Draw the credits onto the form
myCredits.Draw Me.hDC, Me.ScaleWidth, Me.ScaleHeight
NextTime = CurTime + 50 ' Set when the next frame should be executed
End If
Loop
End Sub
Public Sub LoadTXT()
ReDim Strings(0) ' Resize the strings array to no strings
Open App.Path & "\credits.txt" For Input As #1 ' Open the text file
Do Until EOF(1) ' Repeat until the end of the file
ReDim Preserve Strings(UBound(Strings) + 1) ' Resize the array preserving the current entries
Input #1, Strings(UBound(Strings)) ' Load in the string
Loop
Close #1 ' Close the text file
End Sub